<!--
 * @Author: YaYa
 * @Date: 2021-12-29 08:56:36
 * @LastEditTime: 2021-12-29 09:20:29
 * @LastEditors: YaYa
 * @Description: 
 * @FilePath: \study\day04\1-vue入门.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>初始vue</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
  <div id="app">
    {{msg}}
    {{obj}}
    <div v-bind:title="title">v-bind指令学习</div>
    <div :id="id"></div>
    <button v-on:click="toEditTitleHandler">修稿按钮</button>
  </div>
  <script>
    // 构造函数
    let vm = new Vue({
      // 实例绑定节点   每个vue实例只能绑定一个根节点
      el: '#app',
      data: {
        msg: 'hello vue',
        obj: {
          name: 'zhangsan', age: 12
        },
        title: 'hello v-bind',
        id: 'first'

      },
      mothods: {
        // 点击按钮触发这个函数
        toEditTitleHandler() {
          this.title = 'bye vue'
        }

      }

    })
    // let obj=new Object()
  </script>

</body>

</html>